<?php
class Reale_Model_Requirement
{
	protected $_requirement_id;
	protected $_name;
	protected $_contact_no;
	protected $_email;
	protected $category_id;
	protected $_looking_for;
	protected $_enquiry;
	protected $_agent_id;
	protected $_mapper;
	/**
	 * @return the $_requirement_id
	 */
	public function getRequirement_id() {
		return $this->_requirement_id;
	}

	/**
	 * @return the $_name
	 */
	public function getName() {
		return $this->_name;
	}

	/**
	 * @return the $_contact_no
	 */
	public function getContact_no() {
		return $this->_contact_no;
	}

	/**
	 * @return the $_email
	 */
	public function getEmail() {
		return $this->_email;
	}

	/**
	 * @return the $category_id
	 */
	public function getCategory_id() {
		return $this->category_id;
	}

	/**
	 * @return the $_looking_for
	 */
	public function getLooking_for() {
		return $this->_looking_for;
	}

	/**
	 * @return the $_enquiry
	 */
	public function getEnquiry() {
		return $this->_enquiry;
	}

	/**
	 * @return the $_agent_id
	 */
	public function getAgent_id() {
		return $this->_agent_id;
	}

	/**
	 * @param field_type $_requirement_id
	 * @return Reale_Model_Requirement
	 */
	public function setRequirement_id($_requirement_id) {
		$this->_requirement_id = $_requirement_id;
		return $this;
	}

	/**
	 * @param field_type $_name
	 * @return Reale_Model_Requirement
	 */
	public function setName($_name) {
		$this->_name = $_name;
		return $this;
	}

	/**
	 * @param field_type $_contact_no
	 * @return Reale_Model_Requirement
	 */
	public function setContact_no($_contact_no) {
		$this->_contact_no = $_contact_no;
		return $this;
	}

	/**
	 * @param field_type $_email
	 * @return Reale_Model_Requirement
	 */
	public function setEmail($_email) {
		$this->_email = $_email;
		return $this;
	}

	/**
	 * @param field_type $category_id
	 * @return Reale_Model_Requirement
	 */
	public function setCategory_id($category_id) {
		$this->category_id = $category_id;
		return $this;
	}

	/**
	 * @param field_type $_looking_for
	 * @return Reale_Model_Requirement
	 */
	public function setLooking_for($_looking_for) {
		$this->_looking_for = $_looking_for;
		return $this;
	}

	/**
	 * @param field_type $_enquiry
	 * @return Reale_Model_Requirement
	 */
	public function setEnquiry($_enquiry) {
		$this->_enquiry = $_enquiry;
		return $this;
	}

	/**
	 * @param field_type $_agent_id
	 * @return Reale_Model_Requirement
	 */
	public function setAgent_id($_agent_id) {
		$this->_agent_id = $_agent_id;
		return $this;
	}

/**
     * Constructor
     * 
     * @param  array|null $options 
     * @return void
     */
    public function __construct (array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
    /**
     * Overloading: allow property access
     * 
     * @param  string $name 
     * @param  mixed $value 
     * @return void
     */
    public function __set ($name, $value)
    {
        $method = 'set' . $name;
        if ('mapper' == $name || ! method_exists($this, $method)) {
            throw new Exception('Invalid property specified', Zend_Log::DEBUG);
        }
        $this->$method($value);
    }
    /**
     * Overloading: allow property access
     * 
     * @param  string $name 
     * @return mixed
     */
    public function __get ($name)
    {
        $method = 'get' . $name;
        if ('mapper' == $name || ! method_exists($this, $method)) {
            throw new Exception('Invalid property specified', Zend_Log::DEBUG);
        }
        return $this->$method();
    }
    /**
     * Set object state
     * 
     * @param  array $options 
     * @return Reale_Model_Estate_Property
     */
    public function setOptions (array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
    
	/**
	 * 
	 * Setter function for requirement mapper 
	 * @param Reale_Model_RequirementMapper
	 */
	public function setMapper($mapper) {
		$this->_mapper = $mapper;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for requirement mapper
	 * @return Reale_Model_RequirementMapper $_mapper
	 */
	public function getMapper(){
        if (null === $this->_mapper) {
            $this->setMapper(new Reale_Model_RequirementMapper());
        }
        return $this->_mapper;
    }
    
    public function save(){
    	return $this->getMapper()->save($this);
    }
    
	public function fetchAll(){
    	return $this->getMapper()->fetchAll($this);
    }
    
    public function acknowledge(){
    	return $this->getMapper()->acknowledge($this);
    }
	
}
?>